<include file="header"/>
<body>
<div class="wraper">
    <div class="pop-box" id="announcements">
        <div class="main">
            <p class="iconfont icon-shenheshibai"></p>
            <div class="main-text">
                <p class="stress text-center">结束时间小于开始时间</p>
                <div class="btn-box clearfix">
                </div>
            </div>
        </div>
    </div>
    <div class="banner">
        <div class="swiper-container">
            <div class="swiper-wrapper">
                <volist name="imageCount" id="vo">
                    <div class="swiper-slide"><a href="#"><img src="{BEESCRM:$vo}"></a></div>
                </volist>

                <!--<div class="swiper-slide"><a href="#"><img src="/assets/park/huser/images/activity.jpg"></a></div>-->
                <!--<div class="swiper-slide"><a href="#"><img src="/assets/park/huser/images/activity.jpg"></a></div>-->
            </div>

            <div class="swiper-pagination"></div>

            <div class="cover"><img src="/assets/park/huser/images/cover.png"/></div>
        </div>
    </div>
    <div class="btn-box">
        <div class="tab-box tab-type clearfix">
            <a href="#" class="tab-list actived" id="fullTime">全职陪护</a>
            <a href="#" class="tab-list" id="partTime">兼职陪护</a>
            <!--<a href="#" class="tab-list">预约记录</a>-->
        </div>
        <div class="form-box">
            <div class="form-list tb-mode">
                <p class="field tb-cell"><span class="iconfont icon-start"></span></p>
                <p class="area tb-cell"><input class="laydate-icon" id="beginTime" placeholder="开始时间" readonly="readonly"/></p>
            </div>
            <div class="form-list tb-mode">
                <p class="field tb-cell"><span class="iconfont icon-end"></span></p>
                <p class="area tb-cell"><input class="laydate-icon" id="endTime" placeholder="结束时间" readonly="readonly"/></p>
            </div>
            <div id="datePlugin"></div>
        </div>

        <a href="#" class="single-btn" id="serach">查找</a>
    </div>

    <!-- <a href="tel:0571-56621841" class="tel"><img src="/assets/park/huser/images/tel.png"/></a> -->
    <div class="bottom-fixed">
        <if condition="$goAppointment eq 1"><a href="javascript:void(0);" class="btn half-btn blue-btn" style="background: #bbb">您已有预约</a>
            <else/><a href="/Park/huser/resultlist/identifier/1/beginTime/false/endTime/false" class="btn half-btn blue-btn" id="isGoOrdered">我要预约</a>
        </if>
        <a href="/Park/huser/appointList" class="btn half-btn">订单中心</a>        
    </div>
    <!--<div class="bottom-box">
        <p class="copyright">杭州青橄榄网络技术有限公司 技术支持</p>
    </div>-->
</div>

</body>
<script src="/assets/park/huser/js/jquery-2.1.0.min.js"></script>
<script src="/assets/park/huser/js/swiper.min.js"></script>
<!--<script src="/assets/park/huser/js/date.js"></script>-->
<!--<script src="/assets/park/huser/js/iscroll.js"></script>-->
<script type="text/javascript" src="/assets/park/huser/js/laydate.js"></script>
<script type="text/javascript">
    !function(){
        laydate.skin('molv');//切换皮肤，请查看skins下面皮肤库
    }();

    //日期范围限制
    var start = {
        elem: '#beginTime',
        format: 'YYYY-MM-DD',
        min: laydate.now(), //设定最小日期为当前日期
        max: '2099-06-16', //最大日期
//        istime: true,
        istoday: false,
        choose: function(datas){
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };

    var end = {
        elem: '#endTime',
        format: 'YYYY-MM-DD',
        min: laydate.now(),
        max: '2099-06-16',
//        istime: true,
        istoday: false,
        choose: function(datas){
            start.max = datas; //结束日选好后，充值开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
</script>
<script>
    $(function(){
        $('#appointer').click(function(){
            $(this).parent('.btn-box').hide();
           $('.hide').show();
        });

        var height = $(document).height();
        var bottombox_height = $('.bottom-box').outerHeight();
        $('.wraper').css("minHeight",height);
        $('.wraper').css("paddingBottom",bottombox_height);

        var swiper = new Swiper('.banner .swiper-container', {
            pagination: '.banner .swiper-pagination',
            paginationClickable: true,
            spaceBetween: 30,
            centeredSlides: true,
            autoplay: 2500,
            autoplayDisableOnInteraction: false,
            loop: true
        });

        setTimeout(function(){
            var cover_h = $('.cover').height();
            $('.swiper-wrapper').css('marginBottom',cover_h * 0.55);
            $('.banner .swiper-container-horizontal > .swiper-pagination').css('bottom',cover_h * 0.55 + 15);
        },100)
    })
    $("#announcements").hide();
    $("#serach").on('click',function(){
        var beginTime = $("#beginTime").val();
        var endTime = $("#endTime").val();
        if(endTime < beginTime){
            $("#announcements").show();
            setTimeout('setPox()',2000);
        }else{
            //验证操作
                var beginTime = $('#beginTime').val();
                var endTime = $('#endTime').val();
                $.ajax({
                    url: "/Park/huser/join",
                    type: "post",
                    dataType: 'json',
                    async: true,
                    data:{identifier:identifier,beginTime:beginTime,endTime:endTime},
                    success: function (data) {
                        if (data.err_code == 200) {
                            location.href="/Park/huser/resultlist/identifier/"+data.isCooke+"/beginTime/"+data.beginTime+"/endTime/"+data.endTime;
                        }else {
                            alert('请选择开始结束时间');
                        }
                    }
            });
        }
    });

    var identifier = 1;

    $('#fullTime').on('click',function()
    {
        $('#fullTime').attr('class','tab-list actived');
        $('#partTime').attr('class','tab-list');
        identifier = 1;//标识符 兼职
    });

    $('#partTime').on('click',function()
    {
        $('#partTime').attr('class','tab-list actived');
        $('#fullTime').attr('class','tab-list');
        identifier = 2;//标识符 全职
    });


    function setPox()
    {
        $("#announcements").hide();
    }

</script>
</html>
